﻿using System;

namespace CalendarControl
{
    public class HelperMethods
    {
        public static DateTime GetEndOfMonth(int Month, int Year)
        {
            return new DateTime(Year, Month, DateTime.DaysInMonth(Year, Month), 23, 59, 59, 999);
        }

        public static DateTime GetStartOfMonth(int Month, int Year)
        {
            return new DateTime(Year, Month, 1, 0, 0, 0, 0);
        }

        public static string LoadMonthName(Months selectedMonth)
        {
            string retValue = string.Empty;

            switch (selectedMonth)
            {
                case Months.January:
                    retValue = "January";
                    break;

                case Months.February:
                    retValue = "February";
                    break;

                case Months.March:
                    retValue = "March";
                    break;

                case Months.April:
                    retValue = "April";
                    break;

                case Months.May:
                    retValue = "May";
                    break;

                case Months.June:
                    retValue = "June";
                    break;

                case Months.July:
                    retValue = "July";
                    break;

                case Months.August:
                    retValue = "August";
                    break;

                case Months.September:
                    retValue = "September";
                    break;

                case Months.October:
                    retValue = "October";
                    break;

                case Months.November:
                    retValue = "November";
                    break;

                case Months.December:
                    retValue = "December";
                    break;
            }

            return retValue;
        }
    }

    public enum Months
    {
        January = 1,
        February = 2,
        March = 3,
        April = 4,
        May = 5,
        June = 6,
        July = 7,
        August = 8,
        September = 9,
        October = 10,
        November = 11,
        December = 12
    }
}